﻿using DiaoPaiDaYin;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Luna小店.UC.查询
{
    public partial class Frm客户姓名查信息 : DevExpress.XtraEditors.XtraForm
    {
        public Frm客户姓名查信息()
        {
            InitializeComponent();
        }

        private void textBox姓名_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                this.Refresh(this.textBox姓名.Text.Trim());
            }
        }

        private void Refresh(String name)
        {
            #region sql
            String sql = "SELECT\n" +
                "	a_customer_address_p.ADDRESS_ID,\n" +
                "	a_customer_address_p.CUSTOMER_ID,\n" +
                "	a_customer_address_p.CONSIGNEE AS `姓名`,\n" +
                "	a_customer_address_p.MOBILE AS `手机号`,\n" +
                "	CONCAT( a_customer_address_p.ADDRESS_PROVINCE_CD, a_customer_address_p.ADDRESS_CITY_CD, a_customer_address_p.ADDRESS_DISTRICT, a_customer_address_p.ADDRESS_DETAIL ) AS `地址` \n" +
                "FROM\n" +
                "	a_customer_address_p \n" +
                "WHERE\n" +
                "	CONSIGNEE LIKE '%"+name+"%';";
            #endregion
            gridControl客户信息.DataSource = SQLmtm.GetDataTable(sql);
        }
    }
}
